package crazy.io;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.PrintStream;

import com.sun.org.apache.bcel.internal.generic.NEW;

public class PrintStreamTest
{
	public static void main(String[] args) throws Exception
	{
		PrintStream ps = null;
		FileOutputStream fos = null;
		try
		{
			fos = new FileOutputStream("D:\\test.txt");
			ps = new PrintStream(fos);
			ps.println("this is string");
			ps.println(new PrintStreamTest());
		}
		catch (Exception e)
		{
			// TODO: handle exception
		}
		finally
		{
			if (ps !=null)
			{
				ps.close();
			}
		}
	}
}
